<!DOCTYPE html>
	
	<div class="layui-row layui-form" style="padding-top: 20px;">
		<div class="layui-form-item layui-col-md2">
			<label class="layui-form-label">班级</label>
			<div class="layui-input-block">
				<select name="interest" lay-filter="bj" >
					<option value=""></option>
				    <option th:each="bj:${classes}" th:value="${bj.id}" th:text="${bj.name}">写作</option>
				</select>
			</div>
		</div>
	</div>
	<hr class="layui-bg-green">	
	<table id="student-table"></table>	  
<script type="text/javascript">
var $=layui.$;

var option={
	elem:'#student-table',
	title:'学生列表',
	path:'student',
	addurl:'edit',
	height:'full-220',
	toolbar: '',
	cols:[
		[
			{field:'id',title:'ID'},
			{field:'username',title:'学号'},
			{field:'name',title:'姓名' },
			{field:'sex',title:'性别' },
			{field:'job',title:'职务' }
		]
	]
};
$(function(){
	var stuTable=new LayUiTable(option);
	stuTable.init();
	layui.use('form', function(){
		var form = layui.form;
		form.render();
			form.on('select(bj)',function(data){
			var value=data.value;
			if(value.length>0){
				stuTable.ops.postData={classId:value};
				table.reload('id',{toolbar: 'default',where:{classId:value}});
			}else{
				stuTable.ops.postData={};
				table.reload('id',{toolbar: '',where:{classId:value}});
			}
		});
	});

});

</script>
